package com.bafa.front.postlogon;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.bafa.exceptions.ErrorException;
import com.bafa.front.DaddyServlet;
import com.bafa.front.utils.FrontUtils;

public class PostLogonServlet extends DaddyServlet {

	public String url = "logon.bafa";
	@Override
	public void doEvent(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, ErrorException {
		try{
			if(FrontUtils.isLoggedOn(request))
		
			doPostLogonEvent(request,response);
		else{
			ErrorException error = new ErrorException();
			error.addErrorMessage("You have to logon for this function. Please logon.");
			throw error;
		}
		}catch(Exception e){
			e.printStackTrace();
		}
	}
	
	public void doPostLogonEvent(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, ErrorException {
		
	}
	
	public String getURL(){
		return url;
	}
}
